export const getRole = () => {
  try {
    return wx.getStorageSync('role')
  } catch (error) {
    return 'user'
  }
}


export const setRole = (role = 'user') => {
  try {
    wx.setStorageSync('role', role)
  } catch (error) {
    wx.setStorage({
      key: "role",
      data: role
    })
  }
}


export const clearRole = () => {
  setRole()
}